package com.qf.Service.impl;

import com.qf.Dao.InformDao;
import com.qf.Dao.impl.InformDaoImpl;
import com.qf.Service.InformService;
import com.qf.entity.SysNotice;

import java.sql.SQLException;
import java.util.List;

public class InformServiceImpl implements InformService {
    private InformDao informDao = new InformDaoImpl();


    @Override
    public List<SysNotice> selectNotice(int id) {
        try {
            return informDao.selectNotice(id);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public int addNotice(SysNotice id) {
        try {
            return informDao.addNotice(id);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return -1;
    }

    @Override
    public int deleteNotice(String title) {
        try {
            return informDao.deleteNotice(title);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return -1;
    }

    @Override
    public int updateNotice(SysNotice sysNotice) {
        try {
            return informDao.updateNotice(sysNotice);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return -1;
    }

}
